//
//  MHChangeInformationViewController.m
//  ManHua
//
//  Created by 赵永泉 on 15/10/31.
//  Copyright © 2015年 蓝欧科技. All rights reserved.
//

#import "MHChangeInformationViewController.h"
#import "MHChangeInformationListController.h"
#import <RESideMenu.h>

@interface MHChangeInformationViewController ()
@property (nonatomic, strong) MHChangeInformationListController *tableViewVC;

@end

@implementation MHChangeInformationViewController

- (void)setChangeHeaderBlock:(ChangeHeaderBlock)changeHeaderBlock
{
    _changeHeaderBlock = changeHeaderBlock;
    self.tableViewVC.changeHeaderBlock = changeHeaderBlock;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"个人资料";
    self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:kThemeColor,UITextAttributeTextColor,nil];
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    self.tableViewVC = [[UIStoryboard storyboardWithName:@"MHChangeInformantion" bundle:nil] instantiateInitialViewController];
        self.tableViewVC.view.frame = CGRectMake(0, 64, Width, Height - 64);
    self.tableViewVC.userInfo = self.userInfo;
    __weak MHChangeInformationViewController *test = self;
    if (self.changeHeaderBlock != nil) {
        test.tableViewVC.changeHeaderBlock = self.changeHeaderBlock;
    }
    self.tableViewVC.returnRootLeftVCBlock = ^()
    {
        [test.sideMenuViewController hideMenuViewController];
        [test.navigationController popViewControllerAnimated:YES];
    };
    self.tableViewVC.pushChangeDataBlock = ^(UIViewController *VC)
    {
        [test.navigationController pushViewController:VC animated:YES];
    };
    [self.view addSubview:self.tableViewVC.view];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
